<template>
  <cjui-page-panel viewHeightType="full" header="Excel 在线编辑">
    <div id="univerContainer" class="univerContainer"></div>
  </cjui-page-panel>
</template>

<script lang="ts" setup>
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core'
import UniverPresetSheetsCoreZhCN from '@univerjs/preset-sheets-core/locales/zh-CN'
import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets'

import '@univerjs/preset-sheets-core/lib/index.css'

onMounted(() => {
  const { univer, univerAPI } = createUniver({
  locale: LocaleType.ZH_CN,
  locales: {
    [LocaleType.ZH_CN]: mergeLocales(
      UniverPresetSheetsCoreZhCN,
    ),
  },
  presets: [
    UniverSheetsCorePreset({
      container: 'univerContainer',
    }),
  ],
})
univerAPI.createWorkbook({})
})
</script>

<style lang="scss" scoped>
.univerContainer {
  height: 100%;
}
</style>
